package com.yenlien.traceyun.plant.controller;

import com.yenlien.traceyun.plant.entity.ColdDev;
import com.yenlien.traceyun.plant.service.ColdDevService;
import com.yenlien.traceyun.webase.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Date 2022/8/30
 * @Author jiaLong
 * @Descript
 */
@RestController
@RequestMapping("/coldDev")
public class ColdDevController extends BaseController {

    @Autowired
    private ColdDevService coldDevService;


    @PostMapping(value = "/save")
    public Object save(@RequestBody ColdDev coldDev)  {
        return success(coldDevService.save(coldDev));
    }


    @PostMapping(value = "/findByList")
    public Object findByList(@RequestBody ColdDev coldDev) {
        return success(coldDevService.findByList(coldDev));
    }

    @GetMapping(value = "/findAll")
    public Object findAll() {
        return success(coldDevService.findAll());
    }



    @GetMapping(value = "/findByState")
    public Object findByStateAndId(String state) {
        return success(coldDevService.findByCompanyIdAndState(state));
    }

}
